package com.hiquety.tcb.listener;

import com.hiquety.tcb.ui.IndexUI;
import javafx.application.Platform;
import javafx.stage.Stage;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class ShowBtnClickListener implements ActionListener {
    @Override
    public void actionPerformed(ActionEvent e) {
        Platform.runLater(() -> {
            Stage stage = IndexUI.stage;
            if (!stage.isShowing()) {
                stage.setX(stage.getX());
                stage.setY(stage.getY());
                stage.show();
            }
            stage.setAlwaysOnTop(true);
            stage.setAlwaysOnTop(false);
        });
    }
}
